/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bean.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author server
 */
@Entity
@Table(name = "Departments")
@NamedQueries({
    @NamedQuery(name = "Departments.findAll", query = "SELECT d FROM Departments d"),
    @NamedQuery(name = "Departments.findByDepartmentID", query = "SELECT d FROM Departments d WHERE d.departmentID = :departmentID"),
    @NamedQuery(name = "Departments.findByDepartmentName", query = "SELECT d FROM Departments d WHERE d.departmentName = :departmentName"),
    @NamedQuery(name = "Departments.findByDeStatus", query = "SELECT d FROM Departments d WHERE d.deStatus = :deStatus")})
public class Departments implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "DepartmentID")
    private String departmentID;
    @Basic(optional = false)
    @Column(name = "DepartmentName")
    private String departmentName;
    @Basic(optional = false)
    @Column(name = "DeStatus")
    private int deStatus;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "departments")
    private Collection<Vacances> vacancesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "departments")
    private Collection<Employees> employeesCollection;

    public Departments() {
    }

    public Departments(String departmentID) {
        this.departmentID = departmentID;
    }

    public Departments(String departmentID, String departmentName, int deStatus) {
        this.departmentID = departmentID;
        this.departmentName = departmentName;
        this.deStatus = deStatus;
    }

    public String getDepartmentID() {
        return departmentID;
    }

    public void setDepartmentID(String departmentID) {
        this.departmentID = departmentID;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public int getDeStatus() {
        return deStatus;
    }

    public void setDeStatus(int deStatus) {
        this.deStatus = deStatus;
    }

    public Collection<Vacances> getVacancesCollection() {
        return vacancesCollection;
    }

    public void setVacancesCollection(Collection<Vacances> vacancesCollection) {
        this.vacancesCollection = vacancesCollection;
    }

    public Collection<Employees> getEmployeesCollection() {
        return employeesCollection;
    }

    public void setEmployeesCollection(Collection<Employees> employeesCollection) {
        this.employeesCollection = employeesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (departmentID != null ? departmentID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Departments)) {
            return false;
        }
        Departments other = (Departments) object;
        if ((this.departmentID == null && other.departmentID != null) || (this.departmentID != null && !this.departmentID.equals(other.departmentID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.entity.Departments[departmentID=" + departmentID + "]";
    }

}
